<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head> 
   <meta charset="UTF-8">
   <%@ include file="/WEB-INF/views/include/head.jsp"%>
   <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
   <link rel="stylesheet" href="${ctxStatic}/css/layerSm.css">
   <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
   <script src="${ctxStatic}/js/layer.js"></script>
   <script src="${ctxStatic}/js/style.js"></script>
   <script src="${ctxStatic}/jquery-barcode/jquery-barcode.js" type="text/javascript"></script>
   <script type="text/javascript">
   $(document).ready(function(){
       $("#inventoryRequestBarCodeDiv").empty().barcode($("#stockBarCode").val(), "code128",{barWidth:2, barHeight:30,showHRI:false});
    });
	</script>
</head>
<body>
<div class="layerHeader clearfix">
	<p class="headerTitle"><spring:message code="inventory_request_show_title"/></p>
    <div class="headerButton clearfix">
        <!-- 保存 -->
        <button type="button" onClick="window.location.href='${ctx}/purchase/request/form?id=${purchaseRequest.id}'"><spring:message code="write_style_btn"/></button>
        <!-- 取消 -->
        <button onclick="closeWin()"><spring:message code="btn_cancle"/></button>
    </div>
</div>
<div class="smOrderBox">
    <div class="items clearfix">
        <div class="col-33 clearfix">
            <!-- 入库单号 -->
            <p class="tit"><spring:message code="inventory_request_create_requestNo"/></p>
            <p>${purchaseRequest.inventoryRequestNo}</p>
        </div>
        <div class="col-33 clearfix">
            <!-- 入库单条码 -->
            <p class="tit"><spring:message code="inventory_request_create_barCode"/></p>
            <div id="inventoryRequestBarCodeDiv"></div>
            <input type="hidden" id="stockBarCode" name="stockBarCode" value="${purchaseRequest.stockBarCode}">
        </div>     
    </div>
    <div class="items clearfix">
        <div class="col-33 clearfix haveToBox">
            <!-- 供货商名称 -->
            <p class="tit"><spring:message code="inventory_Supplier_name"/></p>
            <p>${purchaseRequest.venderName}</p>
        </div>
        <div class="col-33 clearfix">
            <!-- 入库类别 -->
            <p class="tit"><spring:message code="inventory_request_create_inventoryCategory"/></p>
            <p>${fns:getDictName(purchaseRequest.inventoryCategory)}</p>
        </div>
    </div>
</div>
<div class="tableArea">
    <div class="tableScrollSm" style="overflow:auto;width:1186px;height:470px;">
        <table cellpadding="0" class="tableHead">
            <thead>
            <tr>
                <!-- 操作 -->
                <th style="width:50px;"><spring:message code="inventory_request_create_details_operate"/></th>
                <!-- 采购单号 -->
                <th><p style="width:150px"><spring:message code="purchase_contract_No"/></p></th>
                <!-- 物料图片 -->
                <th class="tab-wltp"><spring:message code="inventory_request_create_details_img"/></th>
                <!-- 名称编码 -->
                <th><p class="width-200px"><spring:message code="inventory_request_create_details_nameCode"/></p></th>
                <!-- 物料类别 -->
                <th><p class="width-100px"><spring:message code="commonMaterial_styleCategory"/></p></th>
                <!-- 颜色 -->
                <th><p class="width-100px"><spring:message code="myWarehouse_color"/></p></th>
                <!-- 成分 -->
                <th><p class="width-100px"><spring:message code="myWarehouse_composition"/></p></th>
                <!-- 幅宽 -->
                <th><p class="width-100px"><spring:message code="myWarehouse_spec"/></p></th>
                <!-- 采购价 -->
                <th><p class="width-100px"><spring:message code="purchasingResume_purchaseUnitPrice"/> </p></th>
                <!-- 采购数量-->
                <th><p class="width-100px"><spring:message code="purchasingResume_purchaseReserveQuantity"/></p></th>                    
                <!-- 申请入库数量 -->
                <th class="width-100px"><spring:message code="inventory_request_create_details_requestQuantity"/></th>
            </tr>
            </thead>
        </table>
        <table cellpadding="0" class="tableBody" id="tableRequestDetails">
        <c:if test="${not empty purchaseRequest.requestDetailsList}">
            <tbody>
            <c:forEach items="${purchaseRequest.requestDetailsList}" var="requestDetailsInfo" varStatus="status">
            <tr>
                <td style="width:50px;">&nbsp;</td>
                <td><p style="width:150px">${requestDetailsInfo.contractMeterialNo}</p></td>
                <td class="tab-wltp">
                  <c:if test="${not empty requestDetailsInfo.filePath}">
                        <img src="${requestDetailsInfo.filePath}" class="wltp">
                  </c:if>
                  <c:if test="${empty requestDetailsInfo.filePath}">
                        <img src="${ctxStatic}/images/pic-none.jpg" class="wltp">
                  </c:if>
                </td>
                <td><p class="width-200px">${requestDetailsInfo.materialNameCn}<br>${requestDetailsInfo.materialCode}</p></td>
                <td><p class="width-100px">${fns:getDictName(requestDetailsInfo.materialCategory)}</p></td>
                <td><p class="width-100px">${requestDetailsInfo.materialColor}</p></td>
                <td><p class="width-100px">${requestDetailsInfo.materialComposition}</p></td>
                <td><p class="width-100px">${requestDetailsInfo.materialSpec}</p></td>
                <td><p class="width-100px"><fmt:formatNumber value="${requestDetailsInfo.purchaseUnitPrice}" pattern="#,##0.#####"/></p></td>
                <td><p class="width-100px"><fmt:formatNumber value="${requestDetailsInfo.purchaseReserveQuantity}" pattern="#,##0.#####"/></p></td>
                <td class="subDetails width-100px"><fmt:formatNumber value="${requestDetailsInfo.requestQuantity}" pattern="#,##0.###"/></td>
            </tr>
            </c:forEach>
            </tbody>
        </c:if>    
        </table>
    </div>
</div>
</body>
</html>